package com.wjt.homestayms.service.impl;

import com.wjt.homestayms.mapper.UserMapper;
import com.wjt.homestayms.pojo.User;
import com.wjt.homestayms.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private UserMapper userMapper;

    public List<User> queryAllUser(){
        return userMapper.selectAllUser();
    }

    public User getUserById(Integer id){
        return userMapper.selectUserById(id);
    }

    public Integer addUser(User user){
        return userMapper.insertUser(user);
    }
}
